From 982da040b234f8c2da349a45111972d04c98f4a8 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Fri, 5 Feb 2016 18:30:28 +0100 Subject: [PATCH] cssimageradial: Only emit one error for wrong position Test included. --- gtk/gtkcssimageradial.c | 5 +---- testsuite/css/parser/Makefile.am | 3 +++ testsuite/css/parser/radial-background-position-error.css | 3 +++ testsuite/css/parser/radial-background-position-error.errors | 1 + .../css/parser/radial-background-position-error.ref.css | 0 5 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 testsuite/css/parser/radial-background-position-error.css create mode 100644 testsuite/css/parser/radial-background-position-error.errors create mode 100644 testsuite/css/parser/radial-background-position-error.ref.css diff --git a/gtk/gtkcssimageradial.c b/gtk/gtkcssimageradial.c index f8024d78ea..3a3b343f8e 100644 --- a/gtk/gtkcssimageradial.c +++ b/gtk/gtkcssimageradial.c @@ -273,10 +273,7 @@ gtk_css_image_radial_parse (GtkCssImage *image, { radial->position = _gtk_css_position_value_parse (parser); if (!radial->position) - { - _gtk_css_parser_error (parser, "Expected a position after 'at'"); - return FALSE; - } + return FALSE; found_one = has_position = TRUE; } else if (!has_size) diff --git a/testsuite/css/parser/Makefile.am b/testsuite/css/parser/Makefile.am index 4479dddac0..6c5a6d9cf3 100644 --- a/testsuite/css/parser/Makefile.am +++ b/testsuite/css/parser/Makefile.am @@ -407,6 +407,9 @@ test_data = \ pseudo-classes-unknown.ref.css \ radial.css \ radial.ref.css \ + radial-background-position-error.css \ + radial-background-position-error.errors \ + radial-background-position-error.ref.css \ selector.css \ selector.ref.css \ shadow.css \ diff --git a/testsuite/css/parser/radial-background-position-error.css b/testsuite/css/parser/radial-background-position-error.css new file mode 100644 index 0000000000..6f654695f1 --- /dev/null +++ b/testsuite/css/parser/radial-background-position-error.css @@ -0,0 +1,3 @@ +a { + background: radial-gradient(at your mom); +} diff --git a/testsuite/css/parser/radial-background-position-error.errors b/testsuite/css/parser/radial-background-position-error.errors new file mode 100644 index 0000000000..252ab5a062 --- /dev/null +++ b/testsuite/css/parser/radial-background-position-error.errors @@ -0,0 +1 @@ +radial-background-position-error.css:2: error: GTK_CSS_PROVIDER_ERROR_SYNTAX diff --git a/testsuite/css/parser/radial-background-position-error.ref.css b/testsuite/css/parser/radial-background-position-error.ref.css new file mode 100644 index 0000000000..e69de29bb2 -- 2.30.2